<{assign var="is_index_home" value=true}>
<{include file="mobile/block/header.html"}>
<section id="index" class="page_center_box">
	<div class="decorate">
		<div class="fillForm_box mb10">
			<h2 class="fontcl1">维修招标</h2>
			<form class="tenders" action="<{link ctl='mobile/truste:save'}>" mini-form="tenders"  method="post">
				<div class="select_box">
					<select class="text full"  id='cate_select' onchange="change(this.value)" >
                         <option value="cat_all" id='cat_all' selected="selected">--全部--</option>
                         <{foreach $cates as $item}>
                            <{if $item.parent_id == 0}>
                                    <option value='<{$item.cat_id}>'><{$item.title}></option>
                            <{/if}>
                        <{/foreach}>
                    </select>
					
					<{foreach $cates as $item}>
                         <{if $item.parent_id == 0}>
                            <select class="text full" id = '<{$item.cat_id}>' onchange = "changes(this.value)" style="display:none;">
                                 <option  value="parent_all">--全部--</option>
                                 <{foreach $cates as $it2}>
                                        <{if $it2.parent_id == $item.cat_id}>
                                            <option  value='<{$it2.cat_id}>'><{$it2.title}></option>
                                        <{/if}>
                                 <{/foreach}>
                            </select>
                         <{/if}>
                    <{/foreach}>
				</div>
				<input type="hidden" id='cat_value' name="data[cate_id]" value="0" /> 
				<input type="text" name="data[title]" placeholder="用一句话描述具体需求！">
				<input type="text" name="data[budget]" placeholder="预算金额">
				<input type="text" name="data[contact]" placeholder="联系人">
				<input type="text" name="data[mobile]" placeholder="联系电话">
				<input type="text" name="data[truste]" placeholder="托管服务费">
				<div  class="select_box"> <{widget id="data/region" city_id=$request.city_id level=2}>
					
					<div class="clear"></div>
				</div>
				<input type="text" name="data[addr]" placeholder="详细地址"  />
				<textarea class="text" name="data[comments]"  placeholder='您的需求'></textarea>
				<div class="select_box">
					<label class="filelab"><input type="file" name='photo' class="file"><span class="filespan"></span></label>
								
				</div>
				<input type="submit" class="btn" value="发布需求 " />
			</form>
		</div>
	</div>
</section>
<!--底部浮动招标开始-->
<script>
	$(document).ready(function(){
	   $("#cat_all").attr("selected",true);
	   $('#cat_value').val(0);
	});
	
	function change(cat_id){
		<{foreach $cates as $item}>
			<{if $item.parent_id == 0}>
				   if(cat_id == <{$item.cat_id}>){
						 $("#"+<{$item.cat_id}>).show();  
				   }else{
						 $("#"+<{$item.cat_id}>).hide();  
				   }
			<{/if}>
		<{/foreach}>
		$(".parent_all").attr("selected",true);
		$('#cat_value').val(cat_id);
	}
	
	function changes(val){
		if(isNaN(val)){
			val = 	$('#cate_select option:selected').val();
		}
		$('#cat_value').val(val);
	}
	</script>  
<{include file="mobile/block/footer.html"}> 